package com.example.gybicycle.common.task;

import com.example.gybicycle.dao.ActiveDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@EnableScheduling
public class taskUtil {
    @Autowired
    private ActiveDao activeDao;
//每天 00:1:00
//    @Scheduled(cron = "0 1 0 * * ?")
@Scheduled(cron = "0 0 */2 * * ?")
    public void startActive(){
        activeDao.startActive();
    }
//    每2小时执行一次
    @Scheduled(cron = "0 0 */2 * * ?")
    public void endActive(){
        activeDao.endActive();
    }
    @Scheduled(cron = "0 0 2 * * ?")
    public void delErrorOrder(){
//    删除押金交付失败订单
//    删除押金支付失败押金数据
//        删除押金


    }
}
